num = 100000

for n in range(2, num):
    # 输出每100中的素数
    if n % 100 == 0:
        print()
    for x in range(2, n):
        if n % x == 0:
            # print(n, "=", x, "*", n // x)
            break
    # 没有可以整除的数
    else:
        # print(n, "为素数")
        print(n, end="  ")
